const http = require('http');
const url = require('url');
function start(route) {
    http.createServer(function (request, response) {
        var pathname = url.parse(request.url).pathname;
        console.log(pathname);
        var text=route(pathname);
        response.writeHead(200, { 'Content-Type': 'text/plain' });
        response.end(text);
    }).listen(8082);
    console.log('server runing')
}

exports.start=start;